#include<iostream>
#include<cstring>
using namespace std;
void cut(char s[])
{
	int len = strlen(s);
	if (strstr(s, "."))
	{
		for (int i = len - 1; s[i] == '0'; i--)
		{
			s[i] = '\0';
			len--;
		}
	}
	if (s[len - 1] == '.')
	{
		s[len - 1] = '\0';
	}
}
int main()
{
	char a[100010];
	char b[100010];
	while (cin >> a >> b) {
		cut(a);
		cut(b);
		if (strcmp(a,b)==0) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
	return 0;
}